package com.yz.xyt.service;

import com.github.pagehelper.PageInfo;
import com.yz.xyt.domain.Leave;
import com.yz.xyt.domain.ResponseResult;
import com.yz.xyt.domain.vo.LeaveVo;

import java.util.List;

public interface ILeaveService {
    int deleteByPrimaryKey(Integer id);

    int insert(Leave record);

    int insertSelective(Leave record);

    Leave selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Leave record);

    int updateByPrimaryKey(Leave record);


    /**
     * 通过学号查询是否正在请假
     * @param studentNumber
     * @return
     */
    Boolean selectInLeaveByStudentNumber(Integer studentNumber);

    /**
     * 通过学号查询异常请假
     * @param studentNumber
     * @return
     */
    Boolean selectErrorLeaveByStudentNumber(Integer studentNumber);

    /**
     * 报备请假
     * @param leave
     * @return
     */
    ResponseResult reportLeave(Leave leave);

    /**
     * 常请假
     * @param leave
     * @return
     */
    ResponseResult normalLeave(Leave leave);

    /**
     * 辅导员审批
     * @param leave
     */
    void instructorApproval(Leave leave);

    /**
     * 书记审批
     * @param leave
     */
    void secretaryApproval(Leave leave);

    /**
     * 学生处审批
     * @param leave
     */
    void studentOfficeApproval(Leave leave);

    /**
     * 分管领导审批
     * @param leave
     */
    void leaderApproval(Leave leave);


    /**
     * 驳回请假
     * @param leave
     */
    void rejectApply(Leave leave);

    /**
     * 审批结束
     * @param leave
     * @param approvalType 审批标识
     */
    void approvalEnd(Leave leave,String approvalType);

    /**
     * 查询所有 未审批和审批中 且 无异常 的请假信息
     * @return
     */
    List<Leave> timeoutNotApproval();

    /**
     * 查询所有 请假中 且 无异常 的请假信息
     * @return
     */
    List<Leave> timeoutNotLeave();

    /**
     * 请假撤销
     * @param leave
     */
    int cancelLeave(Leave leave);

    /**
     * 启用报备请假规则
     * @param ruleId
     */
    void startLeaveRule(Integer ruleId);

    /**
     * 停用报备请假规则
     * @param ruleId
     */
    void stopLeaveRule(Integer ruleId);

    /**
     * 辅导员查询请假列表
     * @return
     */
    List<LeaveVo> selectByFdy(LeaveVo leave);

    /**
     * 书记查询请假列表
     * @param leave
     * @return
     */
    List<LeaveVo> selectBySj(LeaveVo leave);

    /**
     * 学生处查询请假列表
     * @param leave
     * @return
     */
    List<LeaveVo> selectByXsc(LeaveVo leave);

    /**
     * 分管领导查询请假列表
     * @param leave
     * @return
     */
    List<LeaveVo> selectByFgld(LeaveVo leave);


    /**
     * 学生查询请假列表
     * @param leaveVo
     * @return
     */
    List<LeaveVo> selectByStudent(LeaveVo leaveVo);

    /**
     * 分页查询
     * @param leaveVo
     * @return
     */
    PageInfo queryForPage(LeaveVo leaveVo);

    /**
     * 辅导员 处理 超时未销假
     * @param leave
     * @return
     */
    ResponseResult dealLeaveTimeOutNotCancel(Leave leave);

    /**
     * 销假
     * @param leave
     * @return
     */
    int expendedLeave(Leave leave);

    /**
     * 批量审批
     * @param idList
     * @return
     */
    ResponseResult batchAgree(List<String> idList);

    /**
     * 门禁请假信息发送
     * @param leave
     */
    void addCardLeaveInfo(Leave leave);

    /**
     * 门禁销假信息发送
     * @param leave
     */
    void eliminateCardLeave(Leave leave);

    /**
     * 是否能驳回
     * @param leave
     * @return
     */
    boolean isAllowReject(Leave leave);


    List<LeaveVo> getApprovedList(LeaveVo leaveVo);

    List<LeaveVo> selectApprovedListBySj(LeaveVo leaveVo);

    /**
     * 分页查询我已审核的请假
     * 已经进入审核，没有走完审核的请假
     * @return
     */
    PageInfo queryApprovedLeaveForPage(LeaveVo leaveVo);
}
